* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  /* Updated background to match index page */
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  color: #334155;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated floating elements background */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-element {
    position: absolute;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    border-radius: 50%;
    animation: float 20s infinite linear;
}

.floating-element:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 15%;
    animation-delay: -5s;
}

.floating-element:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 20%;
    animation-delay: -10s;
}

.floating-element:nth-child(4) {
    width: 100px;
    height: 100px;
    top: 30%;
    right: 30%;
    animation-delay: -15s;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); opacity: 0.7; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 0.3; }
    100% { transform: translateY(0px) rotate(360deg); opacity: 0.7; }
}

/* Header navigation */
.header-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 1rem 2rem;
    z-index: 100;
    animation: slideDown 0.8s ease-out;
}

.nav-container {
    max-width: 1434px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: #8b5cf6;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Adjust for header navigation */
  padding-top: 80px;
  position: relative;
  z-index: 10;
}

/* Remove sidebar navigation - hide sidebar items */
.sidebar .sidebar-section .sidebar-item {
    display: none;
}

/* Update main layout for no sidebar */
.main-layout {
    display: flex;
    flex: 1;
}

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1500px;
    margin: 0 auto;
    width: 100%;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .container {
        padding-top: 60px;
    }
    
    .main-content {
        padding: 1rem;
    }
}

/* Header */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-btn {
  padding: 0.5rem 1rem;
  background: rgba(241, 245, 249, 0.8);
  color: #64748b;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.back-btn:hover {
  background: rgba(226, 232, 240, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  color: #374151;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #374151;
}

/* 示例按钮样式 */
.input-btn {
  padding: 0.375rem 0.75rem;
  background: #f3f4f6;
  color: #6b7280;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}

.input-btn:hover {
  background: #e5e7eb;
}

.model-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.model-select {
  padding: 0.2rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: white;
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  min-width: 150px;
  transition: all 0.2s ease;
  color: #374151;
  font-weight: 500;
}

.model-select:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.model-select:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
}

/* Main Layout */
.main-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 80px);
  position: relative;
}

/* Sidebar - 固定侧边栏 */
.sidebar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  padding: 1rem;
  width: 150px;
  height: 100%;
  position: fixed;
  left: 0;
  z-index: 50;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.875rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 0.5rem;
  flex-direction: column;
  border: 1px solid transparent;
}

.sidebar-item:hover {
  background: rgba(241, 245, 249, 0.8);
  transform: translateX(4px);
  border-color: rgba(148, 163, 184, 0.2);
}

.sidebar-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #4338ca;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.sidebar-item i {
  width: 1.25rem;
  text-align: center;
}

/* Main Content - 适应固定侧边栏 */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: calc(100vh - 80px);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.module-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
}

.btn {
  padding: 0.625rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.2);
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}


.btn-secondary {
  background: #f8fafc;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #d1d5db;
  color: #374151;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Sub Module Navigation */
.sub-module-nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.6);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.sub-module-buttons {
  display: flex;
  gap: 1rem;
}

.sub-module-btn {
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(241, 245, 249, 0.8));
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  color: #64748b;
  border: 2px solid rgba(226, 232, 240, 0.6);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 160px;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.sub-module-btn i {
  font-size: 0.9rem;
}

.sub-module-btn.active {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: 2px solid #1d4ed8;
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.3);
  font-weight: 600;
  backdrop-filter: blur(15px);
}

.sub-module-btn:hover:not(.active) {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(29, 78, 216, 0.05));
  border-color: rgba(59, 130, 246, 0.4);
  color: #1d4ed8;
  backdrop-filter: blur(15px);
}

/* 修改模型选择器样式 */
.model-selector-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.model-selector-container label {
  font-weight: 500;
  color: #4b5563;
  display: none;
}

.model-dropdown {
  position: relative;
  display: inline-block;
}

.model-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
  font-weight: 500;
  min-width: 150px;
}

.model-current:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
}

.model-current i {
  font-size: 1rem;
  color: #6b7280;
  margin-right: 0.25rem;
}

.model-current .caret {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.model-dropdown.active .caret {
  transform: rotate(180deg);
}

.model-menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: auto;
  min-width: 100%;
  white-space: nowrap;
  margin-top: 0.25rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: none;
  overflow: hidden;
}

.model-dropdown.active .model-menu {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.model-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.model-item:hover {
  background-color: #f9fafb;
}

.model-item.active {
  background-color: #f3f4f6;
}

.model-item.active::after {
  content: "\f00c";
  font-family: "Font Awesome\ 6 Free";
  font-weight: 900;
  margin-left: 0.75rem;
  color: #8b5cf6;
}

.model-item i {
  font-size: 1rem;
  color: #6b7280;
}

/* 旧的select样式保留但隐藏，用于保持功能兼容性 */
.model-select {
  display: none;
}

/* Input/Output Layout */
.io-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.input-section {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #374151;
  background: #f9fafb;
  border-radius: 0.75rem 0.75rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-content {
  flex: 1;
  padding: 1.5rem;
  min-height: 300px;
}

.input-textarea {
  width: 100%;
  min-height: 250px;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  resize: vertical;
  font-size: 0.875rem;
  line-height: 1.6;
  font-family: inherit;
}

.input-textarea:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-textarea::placeholder {
  color: #9ca3af;
}

/* Results Section */
.results-section {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.results-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0.75rem 0.75rem 0 0;
}

.results-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.tab-button {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  color: #6b7280;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: 0.375rem;
  transition: all 0.2s;
}

.tab-button.active {
  background: #8b5cf6;
  color: white;
}

.tab-button:hover:not(.active) {
  background: #f3f4f6;
}

.results-content {
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

.output-display {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  min-height: 600px;
}

.answers-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stats-column {
  display: flex;
  flex-direction: column;
}

.output-box {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  min-height: 150px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.output-title {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  word-break: keep-all;
}

/* 复制按钮样式 */
.copy-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.copy-btn:hover {
  background-color: #f3f4f6;
  color: #4b5563;
}

.copy-btn.success {
  color: #10b981;
}

.answer-selector {
  display: flex;
  align-items: center;
}

.selector-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.selector-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.selector-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  border-color: #8b5cf6;
}

.analysis-type-indicator {
  font-size: 0.7rem;
  color: #6b7280;
  font-weight: normal;
  font-style: italic;
}

/* Token Loss and Entropy Analysis Styles */
.token-with-visual {
  display: inline-block;
  margin: 0.25rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  background: white;
  min-width: 120px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  word-break: keep-all;
}

.token-with-visual:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.token-with-visual.highlighted {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
  border-color: #374151;
}

.token-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.token-text {
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
}

.token-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.token-progress-bar {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.token-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.token-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.token-with-visual:hover .token-progress-fill::after {
  left: 100%;
}

.token-value-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.token-value-display {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
}

.token-level-badge {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Loss-specific styles */
.loss-very-high .token-progress-fill {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.loss-very-high .token-value-display {
  color: #dc2626;
}

.loss-very-high .token-level-badge {
  background: #fee2e2;
  color: #dc2626;
}

.loss-high .token-progress-fill {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

.loss-high .token-value-display {
  color: #ef4444;
}

.loss-high .token-level-badge {
  background: #fef2f2;
  color: #ef4444;
}

.loss-medium .token-progress-fill {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.loss-medium .token-value-display {
  color: #f59e0b;
}

.loss-medium .token-level-badge {
  background: #fef3c7;
  color: #f59e0b;
}

.loss-low .token-progress-fill {
  background: linear-gradient(135deg, #84cc16, #a3e635);
}

.loss-low .token-value-display {
  color: #84cc16;
}

.loss-low .token-level-badge {
  background: #ecfccb;
  color: #84cc16;
}

.loss-very-low .token-progress-fill {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.loss-very-low .token-value-display {
  color: #10b981;
}

.loss-very-low .token-level-badge {
  background: #d1fae5;
  color: #10b981;
}

.entropy-very-high .token-progress-fill {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
}

.entropy-very-high .token-value-display {
  color: #0d9488;
}

.entropy-very-high .token-level-badge {
  background: #ccfbf1;
  color: #0d9488;
}

.entropy-high .token-progress-fill {
  background: linear-gradient(135deg, #0891b2, #06b6d4);
}

.entropy-high .token-value-display {
  color: #0891b2;
}

.entropy-high .token-level-badge {
  background: #cdfafd;
  color: #0891b2;
}

.entropy-medium .token-progress-fill {
  background: linear-gradient(135deg, #06b6d4, #22d3ee);
}

.entropy-medium .token-value-display {
  color: #06b6d4;
}

.entropy-medium .token-level-badge {
  background: #ecfeff;
  color: #06b6d4;
}

.entropy-low .token-progress-fill {
  background: linear-gradient(135deg, #06b6d4, #22d3ee);
}

.entropy-low .token-value-display {
  color: #06b6d4;
}

.entropy-low .token-level-badge {
  background: #cffafe;
  color: #06b6d4;
}

.entropy-very-low .token-progress-fill {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.entropy-very-low .token-value-display {
  color: #10b981;
}

.entropy-very-low .token-level-badge {
  background: #d1fae5;
  color: #10b981;
}

/* Legend Styles */
.analysis-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
}

.legend-color {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Statistics Panel */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.stat-item {
  text-align: center;
  padding: 0.75rem;
  background: white;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #374151;
}

.stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.output-text {
  font-size: 0.875rem;
  line-height: 1.8;
  color: #374151;
  word-break: keep-all;
}

/* 确保输出token不换行 */
.output-text .token {
  white-space: nowrap;
  word-break: keep-all;
  display: inline-block;
}

.input-mirror {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  min-height: 120px;
}

.input-mirror-title {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  word-break: keep-all;
}

/* Analysis Summary Styles */
.analysis-summary {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.analysis-summary-title {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0;
  padding: 1rem 1rem 0.75rem 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.analysis-summary-content {
  padding: 1rem;
  min-height: 200px;
}

/* Token Highlighting */
.token {
  display: inline;
  padding: 0.125rem 0.25rem;
  margin: 0.125rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
  word-break: keep-all;
}

/* 内联分数显示区域样式 */
.score-display-area {
  margin-top: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 300px;
  }
}

.score-display-header {
  background: linear-gradient(135deg, #02a9a9, #14b8a6);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.score-display-header i {
  font-size: 1rem;
  opacity: 0.9;
}

.score-display-content {
  padding: 16px;
  background: white;
}

.score-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-token-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 4px;
}

.score-token-text {
  font-weight: 600;
  color: #1e293b;
  font-size: 1rem;
}

.score-token-value {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-weight: 700;
  color: #02a9a9;
  font-size: 1.2rem;
  background: #ccfbf1;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #7dd3fc;
  box-shadow: 0 1px 3px rgba(2, 169, 169, 0.1);
}

.score-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.8rem;
  color: #64748b;
}

.score-range-info {
  display: flex;
  gap: 12px;
}

.score-range-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-range-label {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-range-value {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-weight: 600;
  color: #374151;
  font-size: 0.75rem;
}

.score-percentage-info {
  font-weight: 600;
  color: #02a9a9;
  background: #ccfbf1;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
}

/* 进度条样式 */
.score-progress-container {
  margin-top: 8px;
  padding: 8px 0;
}

.score-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.score-progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.score-progress-percentage {
  font-weight: 700;
  color: #02a9a9;
  font-size: 0.8rem;
  background: #ccfbf1;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.score-progress-bar {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.score-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #02a9a9, #14b8a6);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  animation: progressFillIn 0.8s ease-out;
}

@keyframes progressFillIn {
  from {
    width: 0 !important;
  }
}

.score-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0 4px 4px 0;
}

.score-progress-fill::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.score-section {
  background: #fefefe;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #f1f5f9;
}

/* 分数主要区域 */
.score-main-area {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.score-main-value {
  font-weight: 800;
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  color: #02a9a9;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  text-shadow: 0 1px 2px rgba(2, 169, 169, 0.1);
}

.score-label {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 进度条区域 */
.score-progress-area {
  padding: 1rem;
  background: white;
}

.score-bar-container {
  margin-bottom: 0.75rem;
}

.score-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.score-bar-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.score-percentage {
  font-weight: 700;
  color: #02a9a9;
  font-size: 0.8rem;
  background: #ccfbf1;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.score-bar {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, #02a9a9, #14b8a6);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.score-bar-fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0 4px 4px 0;
}

/* 范围信息区域 */
.score-range-area {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e2e8f0;
}

.score-range-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.score-range-values {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-range-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.score-range-label {
  font-size: 0.65rem;
  color: #64748b;
  margin-bottom: 0.125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-range-value {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-weight: 600;
  color: #374151;
  font-size: 0.8rem;
}

.score-range-divider {
  width: 1px;
  height: 24px;
  background: #e2e8f0;
  margin: 0 0.75rem;
}

/* 说明区域 */
.score-explanation {
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border-top: 1px solid #7dd3fc;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: #02a9a9;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.score-explanation i {
  color: #06b6d4;
  margin-top: 0.125rem;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.token:hover {
  background-color: #e6fffa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(2, 169, 169, 0.2);
}

.token.highlighted {
  background-color: rgb(2, 169, 169);
  color: white;
  box-shadow: 0 2px 4px rgba(2, 169, 169, 0.3);
}

/* Attention Score Visualization - 现在使用动态颜色 */
.token[data-input-id] {
  border-radius: 0.25rem;
  font-weight: 500;
  white-space: nowrap;
  word-break: keep-all;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  margin: 0.0625rem;
  position: relative;
  z-index: 1;
  border: 1px solid transparent;
}

/* 确保注意力高亮token的背景色正确显示 */
.token[data-input-id].attention-highlight {
  background-clip: padding-box;
  font-weight: 600;
}

.token[data-input-id]:hover {
  box-shadow: 0 4px 12px rgba(2, 169, 169, 0.4);
  transform: translateY(-1px);
}

/* 通用防换行规则 */
.output-box,
.input-mirror,
.section-header,
.output-title,
.input-mirror-title {
  word-break: keep-all;
}

/* 确保所有token相关元素不换行 */
.token,
.all-token,
.token-with-visual,
.token[data-input-id],
.token[data-token-id],
.token[data-answer-type] {
  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* Token点击分数显示样式 - 从compression页面复制 */
.token {
  position: relative !important;
  display: inline-block !important;
  white-space: nowrap !important;
}

/* 使用固定定位相对于视口 */
.token-score-display-container {
  position: fixed !important;
  z-index: 2147483647 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* 分数显示样式 */
.token-score-display {
  position: absolute !important;
  z-index: 2147483647 !important;
  pointer-events: none !important;
  background-color: white !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  padding: 0.5rem 0.75rem !important;
  white-space: nowrap !important;
  opacity: 1 !important;
  visibility: visible !important;
  top: 5px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #6b7280;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #02a9a9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #6b7280;
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* 新增注意力分析布局样式 */
.attention-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
  min-height: 500px;
}

.attention-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.attention-column .output-box {
  flex: 1;
  min-height: 280px;
}

.attention-column .input-mirror {
  min-height: 250px;
}

/* 针对不同分析类型的布局样式 */
.output-display {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 2rem;
  align-items: center;
}

/* 注意力分析时使用自定义布局 */
.attention-score .output-display {
  display: block !important;
  width: 100%;
  max-width: 100%;
}

/* All token样式 */
.all-token {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  margin-right: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  word-break: keep-all;
}

.all-token:hover {
  background: #e5e7eb;
  color: #374151;
}

.all-token.highlighted {
  background: linear-gradient(135deg, #02a9a9, #14b8a6);
  color: white;
  border-color: #02a9a9;
  box-shadow: 0 2px 4px rgba(2, 169, 169, 0.3);
}

/* 柱状图对比布局样式 */
.chart-comparison-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.chart-column {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.chart-container {
  min-height: 500px;
  overflow-y: auto;
  width: 100%;
}

/* 柱状图样式 - 简洁优雅布局 */
.chart-container {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: visible;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.chart-title {
  font-weight: 600;
  color: #1f2937;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.chart-title i {
  color: #6366f1;
  font-size: 1.1rem;
}

.chart-summary {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: #6b7280;
}

.chart-summary span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chart-content {
  height: 400px;
  overflow-y: auto;
  padding: 0;
  background: white;
  resize: vertical;
}

/* 自定义拖拽条样式 - 更明显和方便 */
.chart-resize-handle {
  height: 20px;
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  user-select: none;
  transition: all 0.2s ease;
}

.chart-resize-handle:hover {
  background: linear-gradient(to bottom, #f1f5f9, #e2e8f0);
  border-color: #d1d5db;
}

.chart-resize-handle::before {
  content: '';
  width: 30px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  position: relative;
}

.chart-resize-handle:hover::before {
  background: #9ca3af;
}

.chart-resize-handle::after {
  content: '';
  width: 30px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(-6px);
}

.chart-resize-handle:hover::after {
  background: #9ca3af;
}

/* 改进chart-content的resize样式 */
.chart-content {
  resize: none; /* 移除默认的resize */
}

.chart-content::-webkit-scrollbar {
  width: 6px;
}

.chart-content::-webkit-scrollbar-track {
  background: #f9fafb;
}

.chart-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.chart-content::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.chart-item {
  display: grid;
  grid-template-columns: 50px 1fr 60px;
  align-items: center;
  padding: 0px 20px;
  height: auto;
  border-left: 3px solid transparent;
  margin: 0;
  line-height: 1;
}

.chart-item:hover {
  background-color: #f8fafc;
}

.chart-token {
  font-weight: 500;
  color: #374151;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.chart-bar {
  height: 8px;
  border-radius: 4px;
  min-width: 4px;
}

.chart-value {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b5563;
  min-width: 60px;
  text-align: right;
  background: #f9fafb;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.2;
}

/* 损失值柱状图颜色样式 */
.loss-chart .chart-bar.loss-very-high {
  background: #5470c6;
}

.loss-chart .chart-bar.loss-high {
  background: #5470c6;
}

.loss-chart .chart-bar.loss-medium {
  background: #5470c6;
}

.loss-chart .chart-bar.loss-low {
  background: #5470c6;
}

.loss-chart .chart-bar.loss-very-low {
  background: #5470c6;
}

/* 熵值柱状图颜色样式 - 与损失分析相同 */
.entropy-chart .chart-bar.entropy-very-high {
  background: #5470c6;
}

.entropy-chart .chart-bar.entropy-high {
  background: #5470c6;
}

.entropy-chart .chart-bar.entropy-medium {
  background: #5470c6;
}

.entropy-chart .chart-bar.entropy-low {
  background: #5470c6;
}

.entropy-chart .chart-bar.entropy-very-low {
  background: #5470c6;
}

/* Chart Range Selector Styles */
.chart-range-selector {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.range-selector-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.range-selector-label i {
  color: #64748b;
  font-size: 0.875rem;
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.range-inputs input[type="number"] {
  width: 90px;
  padding: 0.375rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  text-align: center;
  background: white;
  transition: border-color 0.2s ease;
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
}

.range-inputs input[type="number"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.range-separator {
  color: #6b7280;
  font-weight: 500;
  font-size: 0.875rem;
}

.range-reset-btn {
  padding: 0.375rem 0.75rem;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #64748b;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.range-reset-btn:hover {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  border-color: #9ca3af;
  color: #374151;
  transform: translateY(-1px);
}

.range-reset-btn i {
  font-size: 0.75rem;
}

/* 图表工具提示样式 */
.chart-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 10000;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 1;
  transition: none;
}

/* 添加小箭头 */
.chart-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(0, 0, 0, 0.9);
}
